$(function(){
    // 首页图表（左）
    var myChart = echarts.init(document.getElementById('index-left-chart'));

        // 指定图表的配置项和数据
        var option1 = {
            title: {
                text: '注册会员情况表'
            },
            tooltip: {},
            legend: {
                data:['人数','销量']
            },
            xAxis: {
                data: ["一月","二月","三月","四月","五月","六月"]
            },
            yAxis: {},
            series: [
                {
                    name: '人数',
                    type: 'bar',
                    data: [5, 20, 36, 10, 10, 20]
                },
                {
                    name: '销量',
                    type: 'line',
                    data: [5, 20, 36, 10, 10, 20]
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option1);
        // 首页图表（右）
        var myChart = echarts.init(document.getElementById('index-right-chart'));

        // 指定图表的配置项和数据
        var option2 = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                x: 'left',
                data:['北京','上海','广州','深圳','南京']
            },
            series: [
                {
                    name:'会员分布',
                    type:'pie',
                    radius: ['50%', '70%'],
                    avoidLabelOverlap: false,
                    label: {
                        normal: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                fontSize: '30',
                                fontWeight: 'bold'
                            }
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data:[
                        {value:335, name:'北京'},
                        {value:310, name:'上海'},
                        {value:234, name:'广州'},
                        {value:135, name:'深圳'},
                        {value:1548, name:'南京'}
                    ]
                }
            ]
        };
        myChart.setOption(option2);


})